package com.hmall.feign.clients;


import com.hmall.common.dto.Item;
import com.hmall.common.dto.PageDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient("itemservice")
public interface ItemClient {

    @GetMapping("/item/list")
    PageDTO<Item> itemPageInfo(@RequestParam(name = "page") Integer page, @RequestParam(name = "size") Integer size) ;

    @GetMapping("/item/getItem/{id}")
    Item getItemById(@PathVariable(name = "id") Long id);

    @GetMapping("/item/stock/{itemId}/{num}")
    void useStockData(@PathVariable(name = "itemId") Long itemId,@PathVariable(name = "num") Integer num);

    @PutMapping("/item")
    void updateItemInfo(@RequestBody Item item);
}
